<script setup>
import { useRouter, useRoute } from 'vue-router'

const router = useRouter()
const route = useRoute()
</script>

<template>
  <div class="app-wrapper">
    <header class="header">
      <router-link to="/" class="logo">
        RAG & Prompt评估平台
      </router-link>
      <el-menu
          mode="horizontal"
          :router="true"
          :default-active="route.path"
          class="nav-menu"
      >
        <el-menu-item index="/rag-evaluation/tasks">
          RAG应用评估
        </el-menu-item>
        <el-menu-item index="/prompt-evaluation/tasks">
          Prompt评估
        </el-menu-item>
      </el-menu>
    </header>

    <main class="main">
      <router-view></router-view>
    </main>

    <footer class="footer">
      <p>© 2024 RAG & Prompt评估平台</p>
    </footer>
  </div>

</template>

<style scoped>
header {
  line-height: 1.5;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }
}
</style>
